package javatwo.annotation.session2;

import java.io.IOException;
import java.net.URL;
import java.util.Map;
import java.util.Set;

import org.junit.Test;
import org.scannotation.AnnotationDB;
import org.scannotation.ClasspathUrlFinder;

public class ScanAnnotation {

	@Test
	public void testScanAnnotation() throws IOException {
		
		URL[] urls = ClasspathUrlFinder.findClassPaths();
		
		AnnotationDB db = new AnnotationDB();
		db.scanArchives(urls);
		
		Map<String, Set<String>> annotationIndex = db.getAnnotationIndex();
		
		Set<String> sClassesNames = annotationIndex.get("javatwo.annotation.session2.SpecialClass");
		
		for(String sClassesName:sClassesNames) {
			System.out.println(sClassesName);
		}
		
		
	}
}
